In the constructor, just after the components have been initialized, a new databinding is created manually. This databinding is equipped with a Format and a Parse event. The Format event is used to convert the binary image data from System.Byte[] (byte array) to an image object. The parse event is used to perform the reverse conversion. The new databinding is assigned to the PictureBox.
The Format event (ByteArrayWithHeaderToImage) converts the byte array to an image by first stuffing the bytes into a MemoryStream. Since the DbDemos database has an 8 byte header in each blob, this data is stripped away. The memory stream is finally passed as a parameter to the constructor of the Bitmap class (descendant from Image class)
The Parse event (ImageToByteArrayWithHeader) receives as input an image object. This image object is saved to a stream. In the stream we also have to write the header (that we stripped away in the Format event) so that we don't break the data format of the database. Once the correct data is in the stream we convert the stream to a byte array.
The Databinding does not keep track of if the image has changed or not. When the grid changes active row, the databinding will try to parse the image and compare to the value stored in the BioLife.Graphic attribute. Since the parse method does not return the same byte array as was originally in the attribute, the object will become dirty. For this reason, the picture box has been set to readonly. The parse event is still called (for unclear reasons), but the value is never written to the underlying attribute.